<?php $title = "系统配置"; ?>
<!DOCTYPE html>
<html>

<head>
    <?php include('css.php'); ?>
</head>

<body>
    <?php
    include('nav.php');
    $sql = "select * from webinfo";
    $stmt = $link->prepare($sql);
    $stmt->execute();
    $result = $stmt->get_result();
    $row = $result->fetch_assoc();
    ?>
    <div class="main-content">
        <div class="container-fluid">
            <!-- 页面标题 -->
            <div class="row mb-4">
                <div class="col">
                    <h1 class="page-title">网站系统配置</h1>
                    <div class="container mt-3">
                        <form method="POST" action="toset.php?action=webinfo">
                            <div class="mb-3">
                                <label for="webname" class="form-label">版权::网站标题</label>
                                <input type="text" class="form-control" id="webname" name="webname" value="<?php echo $row['webname']; ?>">
                            </div>
                            <div class="mb-3">
                                <label for="keyword" class="form-label">网站关键词</label>
                                <input type="text" class="form-control" id="keyword" name="keyword" value="<?php echo $row['keyword']; ?>">
                            </div>
                            <div class="mb-3">
                                <label for="description" class="form-label">网站描述</label>
                                <textarea name="description" class="form-control" id="description" rows="3"><?php echo $row['description']; ?></textarea>
                            </div>
                            <div class="mb-3">
                                <label for="logo" class="form-label">网站Logo</label>
                                <input type="text" class="form-control" id="logo" name="logo" value="<?php echo $row['logo']; ?>">
                            </div>
                            <div class="mb-3">
                                <label for="icp" class="form-label">网站备案号</label>
                                <input type="text" class="form-control" id="icp" name="icp" value="<?php echo $row['icp']; ?>">
                            </div>
                            <div class="mb-3">
                                <label for="icpwa" class="form-label">网安备案号</label>
                                <input type="text" class="form-control" id="icpwa" name="icpwa" value="<?php echo $row['icpwa']; ?>">
                            </div>
                            <div class="mb-3">
                                <label for="wacode" class="form-label">网安备案代码</label>
                                <input type="text" class="form-control" id="wacode" name="wacode" value="<?php echo $row['wacode']; ?>">
                            </div>
                            <div class="mb-3">
                                <label for="address" class="form-label">联系地址</label>
                                <input type="text" class="form-control" id="address" name="address" value="<?php echo $row['address']; ?>">
                            </div>
                            <div class="mb-3">
                                <label for="connect" class="form-label">联系电话</label>
                                <input type="text" class="form-control" id="connect" name="connect" value="<?php echo $row['connect']; ?>">
                            </div>
                            <div class="mb-3">
                                <label for="email" class="form-label">Email</label>
                                <input type="email" class="form-control" id="email" name="email" value="<?php echo $row['email']; ?>">
                            </div>
                            <?php $staticValue = $row['static'] ?? 0; ?>
                            <div class="mb-3">
                                <label for="static">
                                    是否开启伪静态
                                </label>
                                <label for="static">
                                    <input class="form-check-input" type="radio" name="static" value="1" id="yes" <?= $staticValue == 1 ? 'checked' : '' ?>>是
                                </label>
                                <label for="static">
                                    <input class="form-check-input" type="radio" name="static" value="0" id="no" <?= $staticValue == 0 ? 'checked' : '' ?>>否
                                </label>
                            </div>
                            <div class="mb-3">
                                <input type="submit" class="btn btn-primary" value="修改">
                            </div>
                        </form>
                    </div>

                </div>
            </div>
        </div>

    </div>
    <?php include('bottom.php'); ?>
</body>

</html>